package com.partsoft.dits;

/**
 * 监听状态
 */
public enum MonitorStatus {
	
	STARTED(1, "启动"),
	
	STOPPED(2, "停止"),
	
	PAUSED(0, "暂停");
	
	private final int code;
	
	private final String title;
	
	public int getCode() {
		return code;
	}
	
	public String getTitle() {
		return title;
	}

	private MonitorStatus(int code, String title) {
		this.code = code;
		this.title = title;
	}
	
	public static MonitorStatus fromCode(int code) {
		for (MonitorStatus status : MonitorStatus.values()) {
			if (code == status.code) return status;
		}
		return null;
	}
	
}
